package com.gec.zhs.controller;

import java.util.List;

import com.gec.zhs.entity.query.WmsinboundorderdtblQuery;
import com.gec.zhs.entity.po.Wmsinboundorderdtbl;
import com.gec.zhs.entity.vo.ResponseVO;
import com.gec.zhs.service.WmsinboundorderdtblService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 入库通知单明细 Controller
 */
@RestController("wmsinboundorderdtblController")
@RequestMapping("/wmsinboundorderdtbl")
public class WmsinboundorderdtblController extends ABaseController{

	@Resource
	private WmsinboundorderdtblService wmsinboundorderdtblService;
	/**
	 * 根据条件分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(WmsinboundorderdtblQuery query){
		return getSuccessResponseVO(wmsinboundorderdtblService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(Wmsinboundorderdtbl bean) {
		wmsinboundorderdtblService.add(bean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<Wmsinboundorderdtbl> listBean) {
		wmsinboundorderdtblService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增/修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVO addOrUpdateBatch(@RequestBody List<Wmsinboundorderdtbl> listBean) {
		wmsinboundorderdtblService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据IdAndOrderid查询对象
	 */
	@RequestMapping("/getWmsinboundorderdtblByIdAndOrderid")
	public ResponseVO getWmsinboundorderdtblByIdAndOrderid(String id,String orderid) {
		return getSuccessResponseVO(wmsinboundorderdtblService.getWmsinboundorderdtblByIdAndOrderid(id,orderid));
	}

	/**
	 * 根据IdAndOrderid修改对象
	 */
	@RequestMapping("/updateWmsinboundorderdtblByIdAndOrderid")
	public ResponseVO updateWmsinboundorderdtblByIdAndOrderid(Wmsinboundorderdtbl bean,String id,String orderid) {
		wmsinboundorderdtblService.updateWmsinboundorderdtblByIdAndOrderid(bean,id,orderid);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据IdAndOrderid删除
	 */
	@RequestMapping("/deleteWmsinboundorderdtblByIdAndOrderid")
	public ResponseVO deleteWmsinboundorderdtblByIdAndOrderid(String id,String orderid) {
		wmsinboundorderdtblService.deleteWmsinboundorderdtblByIdAndOrderid(id,orderid);
		return getSuccessResponseVO(null);
	}
}